import React, { JSX, Suspense } from 'react'
import { Spin } from 'antd'

export function lazyPense(Pense: React.LazyExoticComponent<() => JSX.Element>): React.ReactNode {
  return (
    <Suspense
      fallback={<Spin style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }} />}
    >
      <Pense />
    </Suspense>
  )
}
